#include<iostream>
#include<math.h>
using namespace std;

# define MAXN 100
int n;
double x[MAXN], y[MAXN];
double sx, sy, sxx, sxy;

int main(){
    scanf("%d", &n);
    for(int i=1;i<=n;i++){
        scanf("%lf %lf",&x[i], &y[i]);
        sx += x[i];
        sy += y[i];
        sxx += x[i]*x[i];
        sxy += x[i]*y[i];
    }
    double a = (sxx*sy-sx*sxy)/(double(n)*sxx-sx*sx);
    double b = (double(n)*sxy-sx*sy)/(double(n)*sxx - sx*sx);
    printf("a:%.19lf, b:%.19lf\n", a, b);
    return 0;
}